home *** CD-ROM | disk | FTP | other *** search
/ Network Supervisor's Toolkit / Network Supervisor's Toolkit.iso / tools / lu62 / debug / rem_mkdr.c < prev    next >
C/C++ Source or Header  |  1996-07-10  |  3KB  |  97 lines

  1. /*
  2.  *  CopyRight 1995. Nicholas Poljakov all rights reserved.
  3.  */
  4. /*************************  REM_MKDR.C  ***************************/
  5. /*                 mkdir for remote disk                          */
  6. /******************************************************************/
  7.  
  8. #include <dos.h>
  9. #include <stdio.h>
  10. #include <string.h>
  11. #include <io.h>
  12. #include <fcntl.h>
  13. #include <stdlib.h>
  14. #include <state1.h>
  15. extern char lu_id[8];
  16. extern char tp_id[8];
  17. extern char tp_exist;
  18. extern struct  part {            /* partner structure */
  19.           char     plu[8] ;         /* str plu_name        */
  20.                   int psl;                    /* str plu_s_limit     */
  21.           char     mode_name[8] ;         /* str mode_name        */
  22.                   int max_ru_size;            /* str ru_h_size       */
  23.                   int pacing;                 /* str =               */
  24.                   unsigned char lu_type;
  25.                }  pstr[4];
  26.  
  27. rem_mkdr(p,from)
  28.    int from;
  29.    char *p;
  30. {
  31.     unsigned  long conv_id;
  32.     unsigned char rts;
  33.     unsigned char wr;
  34.     unsigned int max_length ;
  35.     unsigned  char tpn[64];
  36.     struct rc {
  37.                 unsigned int prim;
  38.                 unsigned long sec;
  39.               } v_rc;
  40.     unsigned long rc;
  41.     char p_lu[9];
  42.     char p_mode[9];
  43.     int length;
  44.  
  45.               if (!tp_exist) {
  46.                                 tp_started
  47.                                             (lu_id,
  48.                                              tp_id,
  49.                                              &rc);
  50.                                 if (rc != 0) {
  51.                                                 return (-1);
  52.                                               }
  53.                                 tp_exist = 1; /* TP_started O.K! */
  54.                              }
  55.  
  56.               strcpy (tpn,"DIR "); /* name of work */
  57.               strcat (tpn, "mkdir");      /* name of sub-funct */
  58.               strcat (tpn, p );      /* name of new directory */
  59.               /*conv_id - return param -id work link */
  60.               strcpy(p_lu, pstr[from].plu);
  61.               strcpy(p_mode, pstr[from].mode_name);
  62.                    allocate  (p_lu,
  63.                               p_mode,
  64.                               tpn,
  65.                               WHEN_SESSION_ALLOCATED,
  66.                               NONE,
  67.                               NONE,
  68.                               NULL,
  69.                               NULL,
  70.                               tp_id,
  71.                               &conv_id,
  72.                               NULL,
  73.                               &v_rc) ;
  74.  
  75.  
  76.                   if (v_rc.prim != 0) {
  77.                                           return (-1);
  78.                                        }
  79.                   deallocate (tp_id,
  80.                               conv_id,
  81.                               Flush,
  82.                               &v_rc);
  83.                   if (v_rc.prim != 0) {
  84.                               return -1;
  85.                            }
  86.        return 0;
  87. }
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.